﻿using System.Collections.Generic;

namespace Finance.TodoSoft
{
	public class TracedList<T> : List<T>, IList<T>
	{
		public List<T> Removed { get; set; }

		public TracedList()
		{
			Removed = new List<T>();
		}

		public new bool Remove(T item)
		{
			var result = base.Remove(item);

			if (result)
				Removed.Add(item);

			return result;
		}

		bool ICollection<T>.Remove(T item)
		{
			return Remove(item);
		}
	}
}
